package it.antonio.ilpizze.aop.pointcut;

import it.antonio.ilpizze.aop.Pointcut;
import it.antonio.ilpizze.reflection.MethodAccessor;

import java.lang.annotation.Annotation;

public class AnnotatedMethodPointcut implements Pointcut {

	private Class<? extends Annotation> annotation;

	public AnnotatedMethodPointcut(Class<? extends Annotation> annotation) {
		this.annotation = annotation;
	}

	@Override
	public boolean apply(MethodAccessor method) {
		return method.isAnnotationPresent(annotation);
	}

}